import { _decorator, Component, Node } from 'cc';
import { DataItemLayout } from '../../Core/DataItemLayout';
const { ccclass, property } = _decorator;

@ccclass('MainPanl')
export class MainPanl extends Component {

    @property(DataItemLayout)
    btmLayout:DataItemLayout

    @property([Node])
    panels:Node[] = []

    protected onLoad(): void {
        this.btmLayout.bindDatas(["邮件", "排行榜", "天赋", "背包"]).selectItems([0])
    }

    onSingleToggle(data:any, idx:number){
        for (let i = 0; i < this.panels.length; i++) {
            this.panels[i].active = i == idx
        }
    }
}


